package com.ruoyi.common.core.domain;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

public class BaseDTO implements Serializable {

    public static final BaseDTO SUCC = new BaseDTO();
    public static final BaseDTO EMPTY = new BaseDTO("0010", "暂无数据");
    public static final BaseDTO ARGS_ERROR = new BaseDTO("0011", "参数异常");
    public static final BaseDTO GAME_OVER_ERROR = new BaseDTO("8888", "活动已经结束，谢谢参与");
    public static final BaseDTO EXPIRE = new BaseDTO("0008", "访问过期，请重新登录");

    private String code = "0000";

    private String msg = "";

    private boolean flag = false;

    public BaseDTO() {
        super();
    }

    public BaseDTO(String code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
